package com.mabaijing.id2;
//一滴一滴接水方法
import java.io.FileInputStream;
import java.io.InputStream;

public class Domo4 {
    public static void main(String[] args)throws Exception {
        InputStream is = new FileInputStream("hello.txt");

        while(true){
            int data = is.read();//一滴一滴接水方法
            if(data == -1){
                // 所有数据都被读完了
                break;
            }
            byte b = (byte) data;
            System.out.printf("%02x --- %c\n",b ,b);
        }

        is.close();//资源回收
    }
}
